package org.qqcui.designpattern.patterns.proxy.dynamic;

/**
 * 动态代理客户端
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/1 10:23
 **/
public class Client {

    public static void main(String[] args) {
        ITeacherDao teacherDao = new TeacherDao();

        ProxyFactory proxyFactory = new ProxyFactory(teacherDao);
        ITeacherDao proxyInstance = (ITeacherDao) proxyFactory.getProxyInstance();
        System.out.println(proxyInstance.getClass());

        proxyInstance.teach();

        proxyInstance.sayHello("Jack");
    }
}
